<template>
	<view class="content">
		<view class="top">
			<view class="icon">
				<image :src="user.imgUrl" class="tou"></image>
				<view class="nickName">
					<text class="nick">{{user.nickName}}</text>
					<text class="desc">{{user.description}}</text>
				</view>
				<view class="setting" @tap="setting()">
					<image src="../../static/images/right.png"></image>
				</view>
			</view>
			<view class="star">
				<view>关注: {{touch}}</view>
				<view>粉丝: {{star}}</view>
			</view>
		</view>
		<view class="fun">
			 <image class="left" src="../../static/images/5.png" mode=""></image>
			 <view>意见反馈</view>
			 <image class="right" src="../../static/images/right.png"></image>
		</view>

	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import utils from "../../static/js/utils.js"
	export default {
		computed: {
			...mapState(['user','star','touch'])
		},
		data() {
			return {

			};
		},
		methods: {
			process(index) {
				if (index == 6) {
					uni.navigateTo({
						url: '../about/about',
						animationType: 'pop-in',
						animationDuration: 200
					});
				} else if (index == 5) {
					uni.navigateTo({
						url: '../yijian/yijian'
					});
				}

			},
			...mapMutations(['setInfo']),
			setting() {
				uni.navigateTo({
					url: '../setting/setting',
					animationType: 'fade-in',
					animationDuration: 200
				});
			},
			prevIcon() {
				let urls = [this.user.imgUrl];
				let curent = urls[0];
				uni.previewImage({
					current: curent,
					urls: urls
				})
			},
			getInfoByNet(){
				var that = this;
				uni.stopPullDownRefresh();
				utils.get("user/userinfo",{},function(data){
					that.setInfo({
						user:data.user,
						star:data.star,
						touch:data.touch
					})
				});
			},
		},
		onPullDownRefresh() {
			this.getInfoByNet();
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f4f4f4;
	}

	.content {
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.top {
		display: flex;
		flex-direction: column;
		justify-content: center;
		width: 100%;
		background: linear-gradient(to bottom, #FF998B, #FFB272);
	}

	.icon {
		display: flex;
		flex-direction: row;
		width: 100%;
		height: 200upx;
		// align-items: center;
		justify-content: flex-start;

	}

	.tou {
		width: 160upx;
		height: 160upx;
		border-radius: 200upx;
		margin-left: 40upx;
	}

	.nickName {
		height: 160upx;
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		margin-left: 40upx;
		margin-top: 20upx;
		color: #ffffff;
	}

	.nick {
		font-size: 45upx;
	}

	.desc {
		font-size: 30upx;
		width: 350upx;
		margin-top: 8upx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.setting {
		width: 50upx;
		height: 50upx;
		margin-right: 30upx;
		margin-top: 40upx;
		text-align: right;
	}

	.setting image {
		width: 50upx;
		height: 50upx;
	}

	.star {
		width: 100%;
		height: 100upx;
		border-radius: 30upx;
		text-align: center;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.star view {
		width: 30%;
		height: 100upx;
		text-align: center;
		line-height: 110upx;
		color: #ffffff;
	}
	.fun{
		width: 100%;
		height: 110upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		background-color: #ffffff;
		margin-top: 30upx;
	}
	.fun .right{
		width: 40upx;
		height: 40upx;
		margin-right: 30upx;
	}
	.fun .left{
		width: 50upx;
		height: 50upx;
		margin-left: 30upx;
	} 
	.fun view{
		flex: 1;
		height: 110upx;
		font-size: 38upx;
		margin-left: 30upx;
		line-height: 110upx;
	}
</style>
